package com.zhengxin.one.service.impl;

import com.zhengxin.one.entity.SRole;
import com.zhengxin.one.mapper.MeunMapper;
import com.zhengxin.one.mapper.RoleMapper;
import com.zhengxin.one.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;
    //授权查询
    @Override
    public List<SRole> rolefound(String name) {
        return roleMapper.rolefound(name);
    }

    @Override
    public int insertRole(String staff_id, String name, String user_id, String company_id) {
        return roleMapper.insertRole(staff_id,name,user_id,company_id);
    }

    @Override
    public int insertRoleM(String staff_id, String menu_id, String menu_name) {
        return roleMapper.insertRoleM(staff_id,menu_id,menu_name);
    }

    @Override
    public Boolean deleRole(String name, String staff_id) {
        return roleMapper.deleRole(name ,staff_id);
    }

    @Override
    public int deleRoleM(String staff_id) {
        return roleMapper.deleRoleM(staff_id);
    }

    @Override
    public int updataRole(String menu_id, String menu_name, String staff_id) {
        return roleMapper.updataRole(menu_id,menu_name,staff_id);
    }
}
